package com.yanqu.road.server.manager.activity.hsisland;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.yanqu.road.dao.impl.activity.hsisland.HsIslandConfigDaoImpl;
import com.yanqu.road.dao.impl.activity.sonhai.SonHaiConfigDaoImpl;
import com.yanqu.road.entity.activity.ActivityConfig;
import com.yanqu.road.entity.activity.ActivityInfo;
import com.yanqu.road.entity.activity.hsisland.HsIslandPosition;
import com.yanqu.road.entity.activity.hsisland.HsIslandUnionLog;
import com.yanqu.road.entity.activity.hsisland.config.*;
import com.yanqu.road.entity.activity.hsisland.data.HsIslandEventData;
import com.yanqu.road.entity.activity.hsisland.data.HsIslandMonsterData;
import com.yanqu.road.entity.activity.hsisland.data.HsIslandPatronsData;
import com.yanqu.road.entity.activity.hsisland.enums.HsIslandEventIdEnum;
import com.yanqu.road.entity.activity.hsisland.enums.HsIslandMonsterTypeEnum;
import com.yanqu.road.entity.activity.hsisland.enums.HsIslandUnionLogTypeEnum;
import com.yanqu.road.entity.activity.sonhai.config.*;
import com.yanqu.road.entity.config.goods.MallInfo;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.entity.union.activitygroup.UnionActivityGroup;
import com.yanqu.road.entity.union.activitygroup.UnionActivityGroupUnion;
import com.yanqu.road.entity.union.activitygroup.UnionActivityGroupUser;
import com.yanqu.road.exception.BusinessException;
import com.yanqu.road.logic.bussiness.servercenter.ActivityBussiness;
import com.yanqu.road.logic.helper.ActivityHelper;
import com.yanqu.road.pb.activity.HsIslandProto;
import com.yanqu.road.server.CrossBaseServer;
import com.yanqu.road.server.TempCrossMgr;
import com.yanqu.road.server.manager.activity.ActivityMgr;
import com.yanqu.road.server.manager.activity.hsisland.handler.HsIslandIEventHandler;
import com.yanqu.road.server.manager.activity.hsisland.handler.impl.*;
import com.yanqu.road.server.manager.activity.sonhai.CrossSonHaiActivity;
import com.yanqu.road.server.manager.activity.sonhai.CrossSonHaiActivityMgr;
import com.yanqu.road.server.manager.activity.sonhai.handler.IPlotTypeHandler;
import com.yanqu.road.server.manager.union.activitygroup.Cross2UnionActivityGroupMgr;
import com.yanqu.road.utils.date.DateHelper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class CrossHsIslandActivityMgr extends TempCrossMgr {

    /**
     * logger
     */
    private static Logger logger = LogManager.getLogger(CrossSonHaiActivityMgr.class.getName());

    /**
     * 活动MAP,k:activityId,k:groupId
     */
    private static Map<Integer, Map<Integer, CrossHsIslandActivity>> activityMap = new ConcurrentHashMap<>();

    /**
     * 事件策略处理MAP
     */
    private static Map<Integer, HsIslandIEventHandler> eventHandlerMap = new ConcurrentHashMap<>();
    static {
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_PVE.getType(), new HsIslandEventPveHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_PVE_BIG.getType(), new HsIslandEventPveBigHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_PVP.getType(), new HsIslandEventPvpHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_CHOOSE.getType(), new HsIslandEventChooseHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_BOX.getType(), new HsIslandEventBoxHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_BUFF.getType(), new HsIslandEventBuffHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_LIGHT.getType(), new HsIslandEventLightHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_RELIC.getType(), new HsIslandEventRelicHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_KEY.getType(), new HsIslandEventKeyHandler());
        eventHandlerMap.put(HsIslandEventIdEnum.EVENT_REWARD.getType(), new HsIslandEventRewardHandler());
    }

    /**
     * 移除过期活动
     * @return
     * @throws Exception
     */
    @Override
    public boolean removeExpireData() throws Exception {
        Set<Integer> acSet = new HashSet<>();
        long nowTime = System.currentTimeMillis();
        for (Integer activityId : activityMap.keySet()) {
            Map<Integer, CrossHsIslandActivity> groupActivityMap = activityMap.get(activityId);
            if (groupActivityMap != null) {
                for (CrossHsIslandActivity activity : groupActivityMap.values()) {
                    // 展示期过3天后移除内存
                    if (activity == null || activity.getConfig() == null || activity.getConfig().getActivityInfo() == null ||
                            nowTime > activity.getConfig().getActivityInfo().getEndShowTime() * 1000 + 3 * DateHelper.DAY_MILLIONS) {
                        acSet.add(activityId);
                    }
                }
            }
        }
        for (int activityId : acSet) {
            activityMap.remove(activityId);
        }
        return true;
    }

    @Override
    public boolean init() throws Exception {
        return reload();
    }

    @Override
    public boolean reloadConfig() throws Exception {
        reloadActivityConfig();
        return true;
    }

    /**
     * 刷新配置
     */
    public static synchronized void reloadActivityConfig() {
        getLogger().info("CrossHsIslandActivityMgr reloadConfig start");
        for (Map<Integer, CrossHsIslandActivity> groupActivityMap : activityMap.values()) {
            for (CrossHsIslandActivity activity : groupActivityMap.values()) {
                //获取一下新的ActivityInfo
                ActivityInfo activityInfo = ActivityBussiness.getActivityInfoByActivityId(activity.getActivityId());
                if (activityInfo == null) {
                    continue;
                }
//                if (!ActivityHelper.activityInShowTime(activityInfo)) {
//                    continue;
//                }
                //构造活动配置
                HsIslandConfig newConfigData = createConfig(activityInfo);
                //刷新配置信息
                activity.refreshConfig(newConfigData);
                getLogger().info("CrossHsIslandActivityMgr reloadConfig success,activityId:{}", activityInfo.getActivityId());
            }
        }
        getLogger().info("CrossHsIslandActivityMgr reloadConfig end");
    }

    @Override
    public boolean reloadData() throws Exception {
        Map<Integer, ActivityInfo> activityInfoMap = ActivityMgr.getOpenCrossActivityMapByType(eActivityType.HsIsland.getValue());
        //活动加载进内存
        for (ActivityInfo activityInfo : activityInfoMap.values()) {
            //查询活动分组
            Map<Integer, UnionActivityGroup> activityGroupMap = Cross2UnionActivityGroupMgr.getGroupMap(activityInfo.getActivityId());
            if (null != activityGroupMap) {
                for (UnionActivityGroup activityGroup : activityGroupMap.values()) {
                    if (activityGroup.getCrossServerId() == CrossBaseServer.getInstance().getServerId()) {
                        getActivity(activityGroup.getActivityId(), activityGroup.getGroupId());
                    }
                }
            }
        }
        return true;
    }

    @Override
    public boolean stop() {
        return true;
    }

    /**
     * save
     * @return
     */
    @Override
    public boolean save() {
        for (Map<Integer, CrossHsIslandActivity> groupActivityMap : activityMap.values()) {
            for (CrossHsIslandActivity activity : groupActivityMap.values()) {
                try {
                    activity.save();
                }catch (Exception e){
                    getLogger().error("CrossHsIslandActivityMgr activity {} save err", activity.getActivityId(), e.getCause());
                }
            }
        }
        return true;
    }

    /**
     * 创建配置
     * @param activityInfo
     * @return
     */
    private static HsIslandConfig createConfig(ActivityInfo activityInfo) {
        HsIslandConfigDaoImpl dao = new HsIslandConfigDaoImpl();
        //获取活动config
        List<Integer> activityIdList = new ArrayList<>();
        activityIdList.add(activityInfo.getActivityId());
        //condition
        Map<String, ActivityConfig> activityConfigMap = ActivityBussiness.getActivityConfigMap(activityIdList).get(activityInfo.getActivityId());
        //mall
        Map<Integer, MallInfo> mallInfoMap = ActivityBussiness.getActivityMallInfoMap(activityIdList).get(activityInfo.getActivityId());
        //船配置表
        Map<Integer, HsIslandBoatConfig> boatConfigMap = dao.getBoatConfigMap(activityInfo.getActivityId());
        //岛配置
        Map<Integer, HsIslandIslandConfig> islandConfigMap = dao.getIslandConfigMap(activityInfo.getActivityId());
        //事件配置表
        Map<Integer, HsIslandEventConfig> eventConfigMap = dao.getEventConfigMap(activityInfo.getActivityId());
        //PVE配置表
        Map<Integer, HsIslandPveConfig> pveConfigMap = dao.getPveConfigMap(activityInfo.getActivityId());
        //PVP结算配置MAP
        Map<Integer, HsIslandDuelConfig> duelConfigMap = dao.getDuleConfigMap(activityInfo.getActivityId());
        //宝箱配置MAP
        Map<Integer, HsIslandBoxConfig> boxConfigMap = dao.getBoxConfigMap(activityInfo.getActivityId());
        //2选1配置MAP
        Map<Integer, HsIslandChooseConfig> chooseConfigMap = dao.getChooseConfigMap(activityInfo.getActivityId());
        //BUFF配置MAP
        Map<Integer, HsIslandBuffConfig> buffConfigMap = dao.getBuffConfigMap(activityInfo.getActivityId());
        //遗迹藏宝配置MAP
        Map<Integer, HsIslandRelicConfig> relicConfigMap = dao.getRelicConfigMap(activityInfo.getActivityId());
        //BOSS奖励配置MAP
        Map<Integer, HsIslandBossRewardConfig> bossRewardConfigMap = dao.getBossRewardConfigMap(activityInfo.getActivityId());
        //圣柱奖励配置MAP
        Map<Integer, HsIslandGiftConfig> giftConfigMap = dao.getGiftConfigMap(activityInfo.getActivityId());
        return new HsIslandConfig(
                activityInfo,
                activityConfigMap,
                mallInfoMap,
                boatConfigMap,
                islandConfigMap,
                eventConfigMap,
                pveConfigMap,
                duelConfigMap,
                boxConfigMap,
                chooseConfigMap,
                buffConfigMap,
                relicConfigMap,
                bossRewardConfigMap,
                giftConfigMap
        );
    }

    /**
     * 日志对象
     * @return
     */
    public static Logger getLogger() {
        return logger;
    }

    /**
     * 获取活动MAP
     * @return
     */
    public static Map<Integer, Map<Integer, CrossHsIslandActivity>> getActivityMap() {
        return activityMap;
    }

    /**
     * 获取活动
     * @param activityId
     * @param groupId
     * @return
     */
    public static CrossHsIslandActivity getActivity(int activityId, int groupId) {
        Map<Integer, CrossHsIslandActivity> groupActivityMap = activityMap.get(activityId);
        if (groupActivityMap != null) {
            CrossHsIslandActivity activityInfo = groupActivityMap.get(groupId);
            if (activityInfo != null) {
                return activityInfo;
            }
        }
        //初始化活动
        return initActivity(activityId, groupId);
    }

    /**
     * 初始化活动
     * @param activityId
     * @return
     */
    private static CrossHsIslandActivity initActivity(int activityId, int groupId) {
        synchronized (activityMap) {
            Map<Integer, CrossHsIslandActivity> groupActivityMap = activityMap.computeIfAbsent(activityId, k -> new ConcurrentHashMap<>());
            CrossHsIslandActivity activity = groupActivityMap.get(groupId);
            if (activity != null) {
                return activity;
            }
            // 读配置 获取活动信息 保证有活动信息
            ActivityInfo activityInfo = ActivityMgr.getActivityInfoMayLoadDB(activityId);
            if (activityInfo == null) {
                return null;
            }
            //不在展示期（+3天）也不处理了
            if (!ActivityHelper.activityInShowTime(activityInfo)) {
                return null;
            }
            //创建配置
            HsIslandConfig config = createConfig(activityInfo);
            //创建活动
            activity = new CrossHsIslandActivity(config, groupId);
            groupActivityMap.put(groupId, activity);
            return activity;
        }
    }

    /**
     * 获取商会
     * @param activityId
     * @param groupId
     * @param unionId
     * @return
     */
    public static CrossHsIslandUnion getUnion(int activityId, int groupId, String unionId) {
        CrossHsIslandActivity activity = getActivity(activityId, groupId);
        if (activity != null) {
            return activity.getUnion(unionId);
        }
        return null;
    }

    /**
     * 获取玩家
     * @param activityId
     * @param groupId
     * @param userId
     * @return
     */
    public static CrossHsIslandUser getUser(int activityId, int groupId, long userId) {
        CrossHsIslandActivity activity = getActivity(activityId, groupId);
        if (activity != null) {
            return activity.getUser(userId);
        }
        return null;
    }

    /**
     * 获取事件策略MAP
     * @param eventId
     * @return
     */
    public static HsIslandIEventHandler getEventHandler(int eventId) {
        return eventHandlerMap.get(eventId);
    }

    /**
     * 获取配置
     * @param activityId
     * @param groupId
     * @return
     */
    public static HsIslandConfig getConfig(int activityId, int groupId) {
        Map<Integer, CrossHsIslandActivity> groupActivityMap = activityMap.get(activityId);
        if (groupActivityMap != null) {
            CrossHsIslandActivity activity = groupActivityMap.get(groupId);
            if (activity != null) {
                return activity.getConfig();
            }
        }
        return null;
    }

    /**
     * 获取海域
     * @param activityId
     * @param groupId
     * @param unionId
     * @param floorId
     * @return
     */
    public static CrossHsIslandFloor getFloor(int activityId, int groupId, String unionId, int floorId) {
        CrossHsIslandUnion union = getUnion(activityId, groupId, unionId);
        if (union != null) {
            return union.getFloor(floorId);
        }
        return null;
    }

    /**
     * 获取区服ID集合
     * @param activityId
     * @param groupId
     * @return
     */
    private static Set<Long> getServerIdSet(int activityId, int groupId) {
        //获取区服
        UnionActivityGroup groupData = Cross2UnionActivityGroupMgr.getGroupData(activityId, groupId);
        if (groupData != null) {
            //分组活动
            return groupData.getServerSet();
        }
        logger.error("海神岛-获取区服ID集合-分组数据不存在：{},{}", activityId,groupId);
        return null;
    }

    /**
     * 获取区服ID列表
     * @param activityId
     * @param groupId
     * @return
     */
    public static List<Long> getServerIdList(int activityId, int groupId) {
        List<Long> serverIdList = new ArrayList<>();
        Set<Long> serverIdSet = getServerIdSet(activityId, groupId);
        if (serverIdSet == null) {
            return serverIdList;
        }
        serverIdList.addAll(serverIdSet);
        return serverIdList;
    }

    public static void fixBug(int activityId, int groupId, String param) {
        CrossHsIslandActivity activity = getActivity(activityId, groupId);
        if (activity != null) {
            activity.fixBug(param);
        }
    }

//    /**
//     * test
//     */
//    public static void testCreateData() {
//        long userId = 0;
//        Map<Integer, ActivityInfo> activityInfoMap = ActivityMgr.getOpenCrossActivityMapByType(eActivityType.HsIsland.getValue());
//        for (ActivityInfo activityInfo : activityInfoMap.values()) {
//            //查询活动分组
//            Map<Integer, UnionActivityGroup> activityGroupMap = Cross2UnionActivityGroupMgr.getGroupMap(activityInfo.getActivityId());
//            if (null != activityGroupMap) {
//                for (UnionActivityGroup activityGroup : activityGroupMap.values()) {
//                    if (activityGroup.getCrossServerId() == CrossBaseServer.getInstance().getServerId()) {
//                        CrossHsIslandActivity activity = getActivity(activityGroup.getActivityId(), activityGroup.getGroupId());
//                        //遍历商会成员，进入活动
//                        for (UnionActivityGroupUnion unionData : activityGroup.getUnionDataMap().values()) {
//                            for (UnionActivityGroupUser userData : unionData.getUserMap().values()) {
//                                String patronsStr = "[{\"patronsId\":102523,\"power\":3830},{\"patronsId\":102514,\"power\":3819},{\"patronsId\":102512,\"power\":3761},{\"patronsId\":102540,\"power\":3683},{\"patronsId\":102510,\"power\":3628},{\"patronsId\":102530,\"power\":3530},{\"patronsId\":102508,\"power\":3387},{\"patronsId\":102426,\"power\":3314},{\"patronsId\":102417,\"power\":3271},{\"patronsId\":102425,\"power\":3268},{\"patronsId\":102435,\"power\":3268},{\"patronsId\":102455,\"power\":3265},{\"patronsId\":102434,\"power\":3265},{\"patronsId\":102445,\"power\":3264},{\"patronsId\":102415,\"power\":3261},{\"patronsId\":102424,\"power\":3260},{\"patronsId\":102515,\"power\":3259},{\"patronsId\":102505,\"power\":3258},{\"patronsId\":102519,\"power\":3258},{\"patronsId\":102436,\"power\":3255},{\"patronsId\":102522,\"power\":3255},{\"patronsId\":102511,\"power\":3255},{\"patronsId\":102506,\"power\":3253},{\"patronsId\":102414,\"power\":3251},{\"patronsId\":102416,\"power\":3251},{\"patronsId\":102504,\"power\":3251},{\"patronsId\":102454,\"power\":3245},{\"patronsId\":102456,\"power\":3243},{\"patronsId\":102428,\"power\":3242},{\"patronsId\":102438,\"power\":3242},{\"patronsId\":102420,\"power\":3239},{\"patronsId\":102448,\"power\":3233},{\"patronsId\":102423,\"power\":3228},{\"patronsId\":102432,\"power\":3228},{\"patronsId\":102507,\"power\":3228},{\"patronsId\":102458,\"power\":3227},{\"patronsId\":102422,\"power\":3227},{\"patronsId\":102433,\"power\":3227},{\"patronsId\":102453,\"power\":3226},{\"patronsId\":102452,\"power\":3224},{\"patronsId\":102412,\"power\":3223},{\"patronsId\":102410,\"power\":3222},{\"patronsId\":102413,\"power\":3221},{\"patronsId\":102443,\"power\":3221},{\"patronsId\":102442,\"power\":3220},{\"patronsId\":102450,\"power\":3220},{\"patronsId\":102503,\"power\":3220},{\"patronsId\":102500,\"power\":3216},{\"patronsId\":102524,\"power\":3215},{\"patronsId\":102468,\"power\":3214},{\"patronsId\":102502,\"power\":3213},{\"patronsId\":102517,\"power\":3213},{\"patronsId\":102440,\"power\":3212},{\"patronsId\":102430,\"power\":3211},{\"patronsId\":102418,\"power\":3211},{\"patronsId\":102516,\"power\":3208},{\"patronsId\":102421,\"power\":3205},{\"patronsId\":102509,\"power\":3205},{\"patronsId\":102513,\"power\":3205},{\"patronsId\":102521,\"power\":3203},{\"patronsId\":102431,\"power\":3202},{\"patronsId\":102451,\"power\":3198},{\"patronsId\":102441,\"power\":3195},{\"patronsId\":102444,\"power\":3195},{\"patronsId\":102411,\"power\":3193},{\"patronsId\":102501,\"power\":3182},{\"patronsId\":102352,\"power\":3182},{\"patronsId\":102332,\"power\":3182},{\"patronsId\":102321,\"power\":3180},{\"patronsId\":102320,\"power\":3180},{\"patronsId\":102322,\"power\":3180},{\"patronsId\":102331,\"power\":3180},{\"patronsId\":102330,\"power\":3180},{\"patronsId\":102312,\"power\":3180},{\"patronsId\":102351,\"power\":3179},{\"patronsId\":102350,\"power\":3179},{\"patronsId\":102341,\"power\":3177},{\"patronsId\":102310,\"power\":3175},{\"patronsId\":102342,\"power\":3175},{\"patronsId\":102311,\"power\":3174},{\"patronsId\":102313,\"power\":3174},{\"patronsId\":102340,\"power\":3174},{\"patronsId\":102221,\"power\":3166},{\"patronsId\":102220,\"power\":3166},{\"patronsId\":102222,\"power\":3166},{\"patronsId\":102231,\"power\":3166},{\"patronsId\":102230,\"power\":3166},{\"patronsId\":102232,\"power\":3166},{\"patronsId\":102250,\"power\":3165},{\"patronsId\":102251,\"power\":3163},{\"patronsId\":102252,\"power\":3163},{\"patronsId\":102211,\"power\":3160},{\"patronsId\":102210,\"power\":3160},{\"patronsId\":102212,\"power\":3160},{\"patronsId\":102241,\"power\":3160},{\"patronsId\":102240,\"power\":3160},{\"patronsId\":102242,\"power\":3160},{\"patronsId\":102120,\"power\":3157},{\"patronsId\":102130,\"power\":3155},{\"patronsId\":102150,\"power\":3153}]";
//                                List<HsIslandPatronsData> patronsList = JSON.parseObject(patronsStr, new TypeReference<List<HsIslandPatronsData>>() {});
//                                try {
//                                    activity.enterActivity(userData.getUserId(), patronsList);
//                                    userId = userData.getUserId();
//                                } catch (BusinessException e) {
//                                    logger.error("海神岛-test-进入活动：{},{}", userData.getUserId(), e.getCode());
//                                }
//                            }
//                        }
//                    }
//                }
//            }
//        }
//        //生成NPC
//        for (Map<Integer, CrossHsIslandActivity> groupActivityMap : activityMap.values()) {
//            for (CrossHsIslandActivity activity : groupActivityMap.values()) {
//                HsIslandProto.HsIslandDebugReqMsg.Builder debugReqMsg = HsIslandProto.HsIslandDebugReqMsg.newBuilder();
//                debugReqMsg.setActivityId(activity.getActivityId());
//                debugReqMsg.setCode("/hsd-addNpc");
//                debugReqMsg.setParam("2000");
//                try {
//                    activity.debugCode(debugReqMsg.build(), userId);
//                } catch (BusinessException e) {
//                    logger.error("海神岛-test-生成NPC：{}", e.getCode());
//                }
//            }
//        }
//        //每个玩家一个海域
//        for (Map<Integer, CrossHsIslandActivity> groupActivityMap : activityMap.values()) {
//            for (CrossHsIslandActivity activity : groupActivityMap.values()) {
//                for (CrossHsIslandUnion union : activity.getUnionMap().values()) {
//                    for (CrossHsIslandUser user : union.getUserMap().values()) {
//                        //获取当前海域
//                        CrossHsIslandFloor floor = union.getFloor(user.getUserData().getFloorId());
//                        CrossHsIslandFloor targetFloor;
//                        try {
//                            //设置新海域
//                            union.updateMaxFloor();
//                            targetFloor = union.createFloor();
//                            //玩家离开当前海域
//                            floor.removeUser(user);
//                            //玩家进入目标海域
//                            targetFloor.putUser(user);
//                            //海域创建满事件
//                            for (CrossHsIslandIsland island : targetFloor.getIslandMap().values()) {
//                                //岛屿配置
//                                HsIslandIslandConfig islandConfig = activity.getConfig().getIslandConfig(island.getIslandData().getIslandId());
//                                for (Map.Entry<Integer, Set<String>> entry : islandConfig.getMapTypeParamMap().entrySet()) {
//                                    int type = entry.getKey();
//                                    Set<String> set = entry.getValue();
//                                    if (type == 1 || type == 2 || type  == 3) {
//                                        for (String key : set) {
//                                            HsIslandEventData eventData =  new HsIslandEventData(
//                                                    activity.getActivityId(),
//                                                    activity.getGroupId(),
//                                                    targetFloor.getFloorData().getUnionId(),
//                                                    targetFloor.getFloorData().getFloorId(),
//                                                    island.getIslandData().getIslandId(),
//                                                    userId,
//                                                    targetFloor.getUnEventIdAndIncrement(),
//                                                    1,
//                                                    0
//                                            );
//                                            int x = Integer.parseInt(key.split(",")[0]);
//                                            int y = Integer.parseInt(key.split(",")[1]);
//                                            eventData.addPosition(x, y);
//                                            //创建PVE小怪
//                                            HsIslandMonsterData monsterData = activity.createPveMonster(9);
//                                            eventData.setMonsterData(monsterData);
//                                            island.putEvent(eventData);
//                                        }
//                                    }
//                                }
//                            }
//                        } catch (BusinessException e) {
//                            logger.error("海神岛-test-创建海域失败：{}", e.getCode());
//                        }
//                    }
//                }
//            }
//        }
//    }
}
